VERSION 5.00
Object = "{3B7C8863-D78F-101B-B9B5-04021C009402}#1.2#0"; "richtx32.ocx"
Begin VB.Form frmWhois 
   ClientHeight    =   3090
   ClientLeft      =   60
   ClientTop       =   450
   ClientWidth     =   9150
   LinkTopic       =   "Form1"
   ScaleHeight     =   3090
   ScaleWidth      =   9150
   StartUpPosition =   3  'Windows Default
   Begin VB.CommandButton cmdOther 
      Height          =   495
      Left            =   1560
      TabIndex        =   2
      Top             =   2400
      Width           =   1215
   End
   Begin VB.CommandButton cmdClose 
      Cancel          =   -1  'True
      Caption         =   "&Close"
      Default         =   -1  'True
      Height          =   495
      Left            =   120
      TabIndex        =   1
      Top             =   2400
      Width           =   1215
   End
   Begin RichTextLib.RichTextBox txtWhois 
      Height          =   2055
      Left            =   1560
      TabIndex        =   0
      Top             =   240
      Width           =   7335
      _ExtentX        =   12938
      _ExtentY        =   3625
      _Version        =   393217
      ReadOnly        =   -1  'True
      TextRTF         =   $"frmWhois.frx":0000
   End
   Begin VB.Label Label1 
      Height          =   255
      Left            =   120
      TabIndex        =   3
      Top             =   240
      Width           =   1455
   End
End
Attribute VB_Name = "frmWhois"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit

Dim WithEvents IRCInterface As clsModIRC
Attribute IRCInterface.VB_VarHelpID = -1
Dim SpeechInterface As Speech
Attribute SpeechInterface.VB_VarHelpID = -1
Dim whoisnick As String

Private Sub cmdClose_Click()
Unload Me

End Sub

Private Sub cmdOther_Click()
Dim msg As String
msg = InputBox("Enter nickname:", "Nickname")
If msg = "" Then txtWhois.SetFocus: Exit Sub
whoisnick = msg
Me.Caption = "Information - " + whoisnick
txtWhois.Text = ""
txtWhois.SetFocus
txtWhois.Text = "Retrieving information for " + whoisnick + "..." + vbCrLf
IRCInterface.RawSend "WHOIS " + whoisnick

End Sub

Private Sub Form_Load()
Me.Caption = lang.Messages(56)
Label1.Caption = lang.Messages(57)
cmdClose.Caption = lang.Buttons(4)
cmdOther.Caption = lang.Buttons(17)

Set IRCInterface = frmMain.IRCInterface
Set SpeechInterface = frmMain.SpeechInterface
End Sub

Sub DoWhois(ByVal wnick As String)
Me.Show
whoisnick = wnick
Me.Caption = "Information - " + whoisnick
txtWhois.Text = "Retrieving information for " + whoisnick + "..." + vbCrLf
IRCInterface.RawSend "WHOIS " + whoisnick

End Sub

Private Sub Form_Unload(Cancel As Integer)
txtWhois.Text = ""

End Sub

Private Sub IRCInterface_Generic(ByVal Command As String, ByVal Data As String, ByVal Comment As String)

'Perform whois tasks
Select Case Command
Case "379"
txtWhois.Text = txtWhois.Text + whoisnick + " has modes " + TrimNonAlpha(GetFromWord(Data, 3)) + " set." + vbCrLf

Case "335"
txtWhois.Text = txtWhois.Text & whoisnick & " is a Bot; don't bother trying to have a conversation with it." & vbCrLf

Case "307"
txtWhois.Text = txtWhois.Text + "You can't have " & whoisnick + "'s nickname because it has been registered." + vbCrLf

Case "319"
txtWhois.Text = txtWhois.Text + whoisnick + " is on these channels: " + Replace$(TrimNonAlpha(GetFromWord(Data, 3)), " ", ", ") + vbCrLf

Case "312"
txtWhois.Text = txtWhois.Text + whoisnick + " is on server " + Replace$(TrimNonAlpha(GetFromWord(Data, 3)), " :", " - ") + vbCrLf

Case "313", "320"
txtWhois.Text = txtWhois.Text + whoisnick + " " + TrimNonAlpha(GetFromWord(Data, 3)) + "!" + vbCrLf

Case "310"
txtWhois.Text = txtWhois.Text + whoisnick + " should be of great assistance to you." + vbCrLf

Case "401"
txtWhois.Text = txtWhois.Text + "There is no such user." + vbCrLf

Case "318"
txtWhois.Text = txtWhois.Text + "End of information report."
End Select

End Sub


Private Sub txtWhois_Change()

beep: Exit Sub

End Sub
